/*
 * $Id: CleanupArchivalDAO.java,v 1.3 2009/07/10 14:50:16 navdeep_mahajan Exp $
 * 
 * Copyright (C) 2006 General Electric Company. All Rights Reserved.
 * 
 * This software is the confidential and proprietary information of the General
 * Electric Company (GE). You shall not disclose this software and shall use it
 * only in accordance with the terms of the license agreement you entered into
 * with GE.
 * 
 * GE MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
 * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
 * NON-INFRINGEMENT. GE SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE
 * AS A RESULT OF USING, MODIFYING, OR DISTRIBUTING THIS SOFTWARE OR ITS
 * DERIVATIVES.
 */
package com.ge.healthcare.autosc.common.database.dao;

import java.util.ArrayList;

import com.ge.healthcare.autosc.common.ASCUtil;

/**
 * @author 212042764
 * 
 */
public class CleanupArchivalDAO extends BaseDAO implements ICleanupArchivalDAO {

	/**
	 * Eclipse generated
	 */
	private static final long serialVersionUID = -7853585604797748481L;

	/**
	 * Spring needs me but i am not a table so dummy value should be fine
	 */
	public CleanupArchivalDAO() {
		super("CleanupArchivalDAO");
	}

	/**
	 * @see com.ge.healthcare.autosc.common.database.dao.ICleanupArchivalDAO#saveAlways(java.lang.Object)
	 */
	public void saveAlways(Object pojo) {
		super.save(pojo);
	}

	public void performArchivalAndCleanup(Long requestListId) {
		if (ASCUtil.isNullOrEmptyObject(requestListId)) {
			return;
		}
		ArrayList<String> paramNames = new ArrayList<String>();
		paramNames.add("requestListId");
		ArrayList<Object> values = new ArrayList<Object>();
		values.add(requestListId);
		getHibernateTemplate().findByNamedQueryAndNamedParam(
				"ascArchiveAndCleanup", paramNames.toArray(new String[1]),
				values.toArray());
	}
}
